package ArrayStack;

import org.junit.jupiter.api.Test;

import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertIterableEquals;

class ArrayStackTest {
    ArrayStack<Object> stack = new ArrayStack<>(3);

    @Test
    void push() {
        stack.push(1);
        stack.push(2);
        stack.push(3);
        assertIterableEquals(List.of(3, 2, 1), stack);
    }

    @Test
    void pop() {
        stack.push(1);
        stack.push(2);
        stack.push(3);
        assertEquals(3, stack.pop());
        assertEquals(2, stack.pop());
        assertEquals(1, stack.pop());
    }

}